package designs.models.composite;

import java.util.Iterator;
import java.util.LinkedList;

public class MilitaryOfficer implements MilitaryPerson {
	LinkedList< MilitaryPerson> list;
	String name ;
	double salary;
	
	
	public MilitaryOfficer(String name, double salary) {
		super();
		this.name = name;
		this.salary = salary;
		list = new LinkedList<MilitaryPerson>();
	}

	@Override
	public void add(MilitaryPerson person) {
		list.add(person);

	}

	@Override
	public void remove(MilitaryPerson person) {
		list.remove(person);
	}

	@Override
	public MilitaryPerson getChild(int index) {
		// TODO Auto-generated method stub
		return list.get(index);
	}

	@Override
	public Iterator<MilitaryPerson> getAllChild() {
		// TODO Auto-generated method stub
		return list.iterator();
	}

	@Override
	public boolean isLeaf() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public double getSalary() {
		// TODO Auto-generated method stub
		return salary;
	}

	@Override
	public void setSalary(double salary) {
		this.salary = salary;

	}

}
